<template>
  <view class="container">
    <scroll-view scroll-y class="scroll-view">
      <uni-list>
        <uni-list-item 
          v-for="(user, index) in users" 
          :key="index" 
          :title="user.name"
          :note="user.email"
		  clickable
          @click="handleUserClick(user)"
        />
      </uni-list>
    </scroll-view>
  </view>
</template>

<script>
export default {
   data() {
      return {
        users: []
      };
    },
    created() {
      this.generateUsers();
    },
    methods: {
      generateUsers() {
        const userNames = ['我的收藏', '我的订单', '消费记录', '我的车辆', '通行记录', '通行卡'];
        for (let i = 0; i < userNames.length; i++) {
          this.users.push({ name: userNames[i], email: '-------底部线-------' });
        }
      },
      handleUserClick(user) {
        console.log('Clicked user:', user);
        // 在这里你可以添加更多的逻辑，比如跳转到用户详情页
      }
    }
};
</script>

<style scoped>
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.scroll-view {
  width: 90%;
  max-height: 80vh;
  padding: 10px;
  border-radius: 5px;
}
</style>



